using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using System.Reflection;
using System.Diagnostics;
namespace Test {
	class ImgColor {
		static void MainX() {
			string filename="ImgColor.png";
			Font fnt=new Font("tahoma",10);
			int top=3;
			int lef=3;
			int height=810;
			using(Bitmap bmp=new Bitmap(500,height))
			using(Graphics g=Graphics.FromImage(bmp))
			{
				g.Clear(Color.White);
				PropertyInfo[] props=typeof(Color).GetProperties(System.Reflection.BindingFlags.Static|System.Reflection.BindingFlags.Public);
				foreach(PropertyInfo prop in props)
				{
					Color col=(Color)prop.GetValue(null,null);
					Rectangle rect=new Rectangle(lef,top+1,20,fnt.Height-2);
					g.FillRectangle(new SolidBrush(col),rect);
					g.DrawRectangle(Pens.Black,rect);
					g.DrawString(prop.Name,fnt,Brushes.Black,lef+20,top);
					top+=fnt.Height;
					if(top>=height-fnt.Height)
					{
						top=3;
						lef+=160;
					}
				}
				bmp.Save(filename);
			}
			Process.Start(filename);
		}
	}
}
